
\subsection{Surface integrals}
A surface integral is like adding up all the wind on a sail.
In other words, we want to compute
$$\int\!\!\!\int{\bf F\cdot n}\,dA$$
where ${\bf F\cdot n}$ is the amount of wind normal to a tiny parallelogram $dA$.
The integral sums over the entire area of the sail.
Let $S$ be the surface of the sail parameterized by $x$ and $y$.
(In this model, the $z$ direction points downwind.)
By the properties of the cross product we have the following for the unit normal $\bf n$
and for $dA$.
$${\bf n}=\frac{{\frac{\partial S}{\partial x}\times\frac{\partial S}{\partial y}}}
{{\left|\frac{\partial S}{\partial x}\times\frac{\partial S}{\partial y}\right|}}\qquad
dA=\left|\frac{\partial S}{\partial x}\times\frac{\partial S}{\partial y}\right|\,dx\,dy$$
Hence
$$\int\!\!\!\int{\bf F\cdot n}\,dA=\int\!\!\!\int{\bf F}\cdot
\left({\frac{\partial S}{\partial x}\times\frac{\partial S}{\partial y}}\right)\,dx\,dy$$

\bigskip
\noindent
The following exercise is from
{\it Advanced Calculus} by Wilfred Kaplan, p.~313.
Evaluate the surface integral
$$\int\!\!\!\int_S{\bf F\cdot n}\,d\sigma$$

\noindent
where ${\bf F}=xy^2z{\bf i}-2x^3{\bf j}+yz^2{\bf k}$, $S$ is the surface
$z=1-x^2-y^2$, $x^2+y^2\le1$ and $\bf n$ is upper.

\bigskip
\noindent
Note that the surface intersects the $xy$ plane in a circle.
By the right hand rule, crossing $x$ into $y$ yields $\bf n$ pointing upwards hence
$${\bf n}\,d\sigma=\left({\frac{\partial S}{\partial x}\times\frac{\partial S}{\partial y}}\right)\,dx\,dy$$

\noindent
The following Eigenmath code computes the surface integral.
The symbols $f$ and $h$ are used as temporary variables.

\begin{Verbatim}[formatcom=\color{blue},samepage=true]
z = 1 - x^2 - y^2
F = (x y^2 z,-2 x^3,y z^2)
S = (x,y,z)
f = dot(F,cross(d(S,x),d(S,y)))
h = sqrt(1 - x^2)
defint(f,y,-h,h,x,-1,1)
\end{Verbatim}

\noindent
$\displaystyle \tfrac{1}{48}\pi$
